from ihome.utils.python_sms_sdk_master.ronglian_sms_sdk import SmsSDK




class send_sms(object):
    instance=None
    def __new__(cls):
        if cls.instance is None:
            obj=super(send_sms,cls).__new__(cls)
            obj.accId = '8a216da873937383017393b085700052'
            obj.accToken = '81f82dac2d31448497473cf766219b60'
            obj.appId = '8a216da873937383017393b086750058'
            obj.sdk = SmsSDK(obj.accId, obj.accToken, obj.appId)
            cls.instance=obj

        return cls.instance
    def send_message(self,phonenumber,code):
    
        tid = '1'
        mobile = phonenumber
        datas = (code, 5)
        resp = self.sdk.sendMessage(tid, mobile, datas)
        
        return resp
        
    

    
